using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using QuanLyDoanVien.Bussiness;
using QuanLyDoanVien.Controller;

namespace QuanLyDoanVien.Report
{
    public partial class frmRenLuyenHS : DevComponents.DotNetBar.Office2007Form
    {
        public frmRenLuyenHS()
        {
            InitializeComponent();
        }
        DataTable dtRenLuyen = new DataTable();
        List<LopInfo> ds_lop = new List<LopInfo>();
        List<HocSinhInfo> ds_hocsinh = new List<HocSinhInfo>();
        LopCtrl m_LopCtrl = new LopCtrl();
        HocSinhCtrl m_HocSinhCtrl = new HocSinhCtrl();
        HoatDongHocSinhCtrl m_HoatDongHS = new HoatDongHocSinhCtrl();
        private void loadDSLop()
        {
            ds_lop = m_LopCtrl.Lay_DSLop();
           
            combLop.ValueMember = "MaLop";
            combLop.DisplayMember = "TenLop";
            combLop.DataSource = ds_lop;
        }

        private void showRenLuyenHocSinh()
        {
            if (txtMaHocSinh.Text != "")
            {
                dtRenLuyen = m_HoatDongHS.layHDHS(txtMaHocSinh.Text);
                bindingSource1.DataSource = dtRenLuyen;
                this.reportViewer1.RefreshReport();
            }
        }
        private void frmRenLuyenHS_Load(object sender, EventArgs e)
        {

            loadDSLop();
        }

        private void btnTruyXuatHS_Click(object sender, EventArgs e)
        {
            showRenLuyenHocSinh();
        }

        private void btnTruyXuatLop_Click(object sender, EventArgs e)
        {
            if (combLop.SelectedIndex >= 0)
            {
                dtRenLuyen = m_HoatDongHS.layDSHDHocSinh(combLop.SelectedValue.ToString());
                bindingSource1.DataSource = dtRenLuyen;
                this.reportViewer1.RefreshReport();
            }
        }
    }
}